<template>
  <div class="header" :style="{backgroundImage: 'url(' + bgImg + ')'}">
    <div class="gauss-mask"></div>
    <div class="header-content">
      <img class="logo" :src="require('/src/assets/simnple_tool_icon.png')">
      <h1>Simple Tools</h1>
    </div>
    <div class="version">当前版本：{{ version }}</div>
  </div>
</template>

<script>
export default {
  name: "HeaderComponent",
  data() {
    return {
      version: '',
      bgImg: require('/src/assets/img/head_bg.jpg')
    }
  },
  created() {
    this.version = process.env.VUE_APP_VERSION;
    // bingImgApi.getData((data) => {
    //   if (!data || !data.url) return;
    //   this.bgImg = data.url;
    // })
  }
}
</script>

<style lang="scss" scoped>
.header {
  position: relative;
  height: 180px;
  background: url("/src/assets/img/head_bg.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  //background-position-y: 30%;

  .header-content {
    position: absolute;
    width: 90%;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    display: flex;
    align-items: center;
  }

  .logo {
    width: 60px;
    margin-right: 14px;
  }

  h1 {
    color: #ffffff;
    display: block;
    font-size: 40px;
    text-shadow: 2px 4px 2px rgba(0, 0, 0, .2);
  }

  .version {
    position: absolute;
    width: 90%;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
  }
}
</style>
